package basic;

import java.util.Arrays;

public class ArrayCopy01 {
    public static void main(String[] args) {
        int[] arr = {1,3,5,7,9};
        int[] arr2 = Arrays.copyOf(arr,7);
        System.out.println(Arrays.toString(arr2));


       /* String[] names = {"郝振宇","田龙","姬翔空","庄祎博","白云天"};
        String[] names2 = new String[names.length+1];
        System.arraycopy(names,0,names2,1,names.length);
        System.out.println(Arrays.toString(names2));
        names2[0]= "张三";
        System.out.println(Arrays.toString(names2));
        String[] names3 = new String[4];
        System.arraycopy(names,2,names3,0,3);
        System.out.println(Arrays.toString(names3));*/

    }
}
